home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / XAMPP 1.4.14 / xampp-win32-1.4.14-installer.exe / xampp / php / pear / Net / FTP / Observer.php
PHP Script  |  2004-10-01  |  2KB  |  73 lines

  1. <?php
  2.  
  3. // $Id: Observer.php,v 1.1 2004/03/12 23:29:55 toby Exp $
  4.  
  5. /**
  6.  * This class implements the Observer part of a Subject-Observer
  7.  * design pattern. It listens to the events sent by a Net_FTP instance.
  8.  * This module had many influences from the Log_observer code.
  9.  *
  10.  * @version    1.3
  11.  * @author     Laurent Laville <pear@laurent-laville.org>
  12.  * @author     Tobias Schlitt <toby@php.net>
  13.  * @author     Chuck Hagenbuch <chuck@horde.org>
  14.  * @access     public
  15.  * @category   Networking
  16.  * @package    Net_FTP
  17.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  18.  *
  19.  * @example    observer_upload.php          An example of Net_FTP_Observer implementation.
  20.  */
  21.  
  22. class Net_FTP_Observer
  23. {
  24.     /**
  25.      * Instance-specific unique identification number.
  26.      *
  27.      * @var        integer
  28.      * @since      1.3
  29.      * @access     private
  30.      */
  31.     var $_id;
  32.  
  33.     /**
  34.      * Creates a new basic Net_FTP_Observer instance.
  35.      *
  36.      * @since      1.3
  37.      * @access     public
  38.      */
  39.     function Net_FTP_Observer()
  40.     {
  41.         $this->_id = md5(microtime());
  42.     }
  43.  
  44.     /**
  45.      * Returns the listener's identifier
  46.      *
  47.      * @return     string
  48.      * @since      1.3
  49.      * @access     public
  50.      */
  51.     function getId()
  52.     {
  53.         return $this->_id;
  54.     }
  55.  
  56.     /**
  57.      * This is a stub method to make sure that Net_FTP_Observer classes do
  58.      * something when they are notified of a message.  The default behavior
  59.      * is to just do nothing.
  60.      * You should override this method.
  61.      *
  62.      * @param      mixed     $event         A hash describing the net event.
  63.      *
  64.      * @since      1.3
  65.      * @access     public
  66.      */
  67.     function notify($event)
  68.     {
  69.         return;
  70.     }
  71. }
  72. ?>
  73.